<?php

return array(
    'preLoad' => array(
        'app' => array(
            'BWeEvent' => array(
                'connection' => 'weSport'
            )
        )
    ),
    'appMeta' => array(
        'appName' => 'Booking Sports',
        'description' => 'booking sports application',
        'operations' => array(
            'followBooking' => array('displayName' => 'Booking Facility',
                //'class'=>'BSBookingFacilityOperation',
                'permit' => array(BPermit::AllowAccess => BRole::All_Roles),
                'startScreen' => array(
                    'views' => array(
                        'followBooking' => 'followBooking')
                ),
                'messenger' => array(
                    'processJoinSpace' => array(
                        'allow_from' => array(
                            array(
                                'operation' => 'BPersonalApp:applyJoinSpace',
                                'message' => 'applyJoinSpace'
                            //'app' => BAddress::from_all_app,
                            //'operation' => BAddress::from_all_operation,
                            //'user' => BAddress::from_all_user
                            )
                        //if ignor, use operation permit
                        //'permit' => array('allowReceiveMessage' => BRole::All_Roles)
                        ),
                    //'allow_receiver' => array(
                    //if not specify space, use current space
                    //'space' => BMessage::Message_From_Current_App,
                    //if not specify app, use current app
                    //'app' => BMessage::Message_From_Current_App,
                    //'operation' => 'BPersonalApp:applyJoinSpace',
                    //'message' => 'applyJoinSpace'
                    //)
                    ),
                    'applyJoinSpace' => array(
                        'receiver' => array(
                            'operation' => 'BSpaceEngine:manageMember',
                            'message' => 'processJoinSpace'
                        ),
                        //define who can call this message
                        //here means all operation in current space
                        'allow_sender' => array(
                            array(
                                'app' => '*',
                                'operation' => '*',
                            //'app' => BAddress::from_all_app,
                            //'operation' => BAddress::from_all_operation,
                            //'user' => BAddress::from_all_user
                            )
                        ),
                        'allow_to' => array(
                            'operation' => 'BSpaceEngine:manageMember',
                            'message' => 'processJoinSpace'
                        )
                    ),
                )
            ),
            'manageBooking' => array('displayName' => 'Manage Booking',
                'permit' => array(
                    BPermit::AllowAccess => array(
                        BRole::Role_Space_Admin,
                        BRole::Role_Space_Member),
                ),
                'startScreen' => array(
                    'views' => array(
                        'manageBooking' => 'manageBooking')
                ),
            ),
            'adminBooking' => array('displayName' => 'Admin Booking',
                'permit' => array(BPermit::AllowAccess => BRole::Role_Space_Admin),
                'startScreen' => array(
                    'views' => array(
                        'adminBooking' => 'adminBooking')
                )
            )
        )
    ),
    'db' => array(
        'connection' => array(
            'default' => 'weSport',
            'localdb' => array(
                'connectString' => 'mysql:host=localhost;dbname=bilynapp',
                'user' => 'blndba',
                'password' => 'blnpwd'
            ),
            'billeendb2' => array(
                'connectString' => 'mysql:host=billeencom.ipagemysql.com;dbname=billeendb2',
                'user' => 'billeendba',
                'password' => 'dba@billeendb'
            ),
            'weSportTest' => array(
                'connectionString' => 'mysql:host=localhost;dbname=weSport_test',
                'emulatePrepare' => true,
                'username' => 'test',
                'password' => 'password',
                'charset' => 'utf8',
                'tablePrefix' => 'tbl_',
                'enableParamLogging' => true,
            ),
            'weSport' => array(
                'connectionString' => 'mysql:host=localhost;dbname=weSport',
                'emulatePrepare' => true,
                'username' => 'test',
                'password' => 'password',
                'charset' => 'utf8',
                'tablePrefix' => 'tbl_',
                'enableParamLogging' => true,
            ),
        )
    )
);
?>
